package seqlist.leetcode;

/**
 * @author yuisama
 * @date 2022/04/25 19:02
 **/
public class Test {

    public static void main(String[] args) {
        Num82_DeleteDuplicates test = new Num82_DeleteDuplicates();
        int[] data = {1,2,3,3,4,4,4};
        // 还原成链表
        ListNode head = build(data);
        ListNode ret = test.deleteDuplicates(head);

    }

    // 根据相应的链表值，创建一个新的链表，返回创建后的链表头节点
    // [1,2,3,3,4,4,5]
    // 根据题目的测试用例要把这个链表还原出来。
    public static ListNode build(int[] data) {
        ListNode dummyHead = new ListNode();
        ListNode tail = dummyHead;
        // 遍历链表值的数组
        for (int i : data) {
            ListNode node = new ListNode(i);
            tail.next = node;
            tail = node;
        }
        return dummyHead.next;
    }
}



